<template>
  <div>
    <p>数组去重</p>
    <div>
    1. es6
    2. vue
    3. http 协议
    4. websocket 协议
    5. 
    6.
    7.
    8.
    </div>
  </div>
</template>

<script>
export default {
  name: '',
  mounted () {
    this.xFilter()
  },
  methods: {
    xFilter() {
      let arr = [1, 2, 4, 32, 56, 3, 2, 1, 22, 43, 56, 7]

      let newArr = [...new Set(arr)] // [1, 2, 4, 32, 56, 3, 22, 43, 7]

      let arr1 = [1, 23, 3, [1, 2], 5, 3, 5, 24, [1, 2], 56, 23]
      let newArr1 = [...new Set(arr1)]

      console.log(newArr1)
    }
  }
}
</script>

<style>

</style>
